package charpter11.lynx;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Random;

public class NineTeen {
	public static void main(String[] args){
		HashSet<Integer> set = new HashSet<Integer>();
		Random rd = new Random(422);
		for (int i = 0; i < 100; i++){
			set.add(rd.nextInt(422));
		}
		
		System.out.println(set);
		
		List<Integer> keys = new ArrayList<Integer>(set);
		Collections.sort(keys);
		
		LinkedHashSet<Integer> set2 = new LinkedHashSet<Integer>();
		for (Integer integer : keys) {
			set2.add(integer);
		}
		
		System.out.println(set2);
	}
}
